<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>设备环境检测</title>
    <script>
        
            var os = function (){
                        var ua = navigator.userAgent,
                        isWindowsPhone = /(?:Windows Phone)/.test(ua),
                        isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone,
                        isAndroid = /(?:Android)/.test(ua),
                        isFireFox = /(?:Firefox)/.test(ua),
                        isChrome = /(?:Chrome|CriOS)/.test(ua),
                        isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)),
                        isPhone = /(?:iPhone)/.test(ua) && !isTablet,
                        isPc = !isPhone && !isAndroid && !isSymbian;
                        return {
                            isTablet: isTablet,
                            isPhone: isPhone,
                            isAndroid: isAndroid,
                            isPc: isPc
                        };	
                    }();
                    
                    if (os.isAndroid) {   
                    //alert("手机-安卓" );
                        window.location.replace('./mobile.html?os=Android')
                    } else if (os.isPhone) {
                    //    alert("手机-iPhone" );
                        window.location.replace('./mobile.html?os=iPhone')
                    } else if (os.isTablet) {
                    //    alert("平板" );
                        window.location.replace('./mobile.html?os=Tablet')
                    } else if (os.isPc) {
                    //    alert("电脑" );
                        window.location.replace('./desktop.html?os=Pc')
                    }
        
        
    </script>
    <style>
        
        html,body{
            height: 100%;
            -webkit-user-select:none;
            -moz-user-select:none;
            -ms-user-select:none;
            user-select:none;
        }
        
    </style>
</head>
<body>
    






    <script>
        //根据设备宽度计算html的font-size
        function resetHtmlFont(){
            //获取html对象并动态设置font-size = 设备宽度的1/10
            document.documentElement.style.fontSize = screen.width/10 + 'px';
        }
        //执行一下
        resetHtmlFont();
        //如果窗口大小改变了，则重新计算基础font-size
        window.onresize = resetHtmlFont;
    </script>
</body>
</html>